
<?php include_once 'common/header.php';  ?>
<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once 'common/shop_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
		<div class="admin_right_title">
			<strong>商城管理</strong> &gt;&gt;  公告列表
		</div>
		
		<div class="admin_right_con">
			<table border="0" cellspacing="1" cellpadding="0" bgcolor="#CCCCCC">
			  <tr style="color:#0068b7;">
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>编号</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>标题</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>时间</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>作者</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>来源</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>操作</strong></td>
			  </tr>
			  <?php foreach($article_list as $key=>$article){?>
			  <tr id="row_<?php echo $article['id'];?>">
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $article['id'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $article['title'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo date('Y-m-d',$article['ptime']);?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $article['author'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $article['fsource'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF">
				<a href="/ychadmin/shop/notice_view/<?php echo $article['id'];?>" target="_blank">编辑</a>
				<a href="javascript:if(confirm('确定删除文章？')){remove(<?php echo $article['id'];?>);}">删除</a>
				</td>
			  </tr>
			  <?php }?>
			  <tr>
			  	<td colspan="6" align="right">
			  		<form action="/ychadmin/article/articlelist/<?php echo $nid;?>" method="get">
			  			标题：<input type="text" id="title" name="title" value="<?php echo $title?>" />
			  			<input type="submit" value="查询" />
			  		</form>
			  	</td>
			  </tr>
			  <tr>
			  	<td colspan="6"  height="35" align="center" valign="middle" bgcolor="#FFFFFF" class="page"><?php echo $this->pagination->create_links();?></td>
			  </tr>
			</table>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<script>
function remove(id){
	$.ajax({
		type: "post",
		url: "/ychadmin/article/remove/",
		data: "id="+id,
		success: function(msg){
			$("#dialog" ).dialog();
			if(msg == 1){
				$("#msg").html("删除成功！");
				$("#row_"+id).hide();
			}else{
				$("#msg").html("删除失败，请联系管理员！");
			}
			setTimeout(function(){
				$("#dialog" ).dialog("close");
			},3000);
		},
		dataType: "text"
	});
}
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>
